/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.userautentification.dao;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.userautentification.entities.Role;

public class Main {
    
    public static void main(String[] args) {
        
    	 ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");  

    	 RoleDao roleDao = (RoleDao) context.getBean("roleDao");

         Role role = new Role();
         role.setDescription("role1");
         role = roleDao.save(role);
         

         //role = roleDao.findById(role.getId());
 		System.out.println("--->Role No: " + role.getId());
 		System.out.println("--->Descripcion: " + role.getDescription());
 		

 		roleDao.remove(role.getId());
     }
        
    }
    